package com.rqbl.service.impl;

import com.rqbl.entity.User;
import com.rqbl.mapper.UserMapper;
import com.rqbl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public List<User> getAllUser() {
        return userMapper.selectAllUsers();
    }

    @Override
    public int addUser(User user) {
        return userMapper.insertInUser(user);
    }

    @Override
    public User userLogin(User user) {
        User u = userMapper.selectUserByUname(user);
        return u;
    }

    @Override
    public User getUserByName(User user) {
        return userMapper.selectUserByUname(user);
    }

    @Override
    public void updateUserPicture(User user) {
        userMapper.updateUserPicture(user);
    }

    @Override
    public int updateUserPsw(User user) {
        return userMapper.updateUserPsw(user);
    }

    @Override
    public int updateUserInfo(User user) {
        return userMapper.updateUserInfo(user);
    }

}
